<template>
	<view class="page">
		<view class="blue-background"></view>
		<view class="header">
			<!-- <text class="title">评价管理</text> -->
		</view>

		<view class="list">
			<uni-card is-shadow>
				<view class="card-header">
					<text class="name">张女士</text>
					<uni-tag text="查看详情" type="primary" size="large" custom-style="border-radius: 26rpx;" />
				</view>
				<view class="divider" />
				<view class="row">
					<text class="link">订单编号：</text>
					<text class="number">2021010831213</text>
				</view>
				<view class="row">
					<text class="label">综合评分：</text>
					<text class="score">3分</text>
					<!-- <uni-rate :value="3" :max="5" disabled color="#e5e5e2" active-color="#ffff00" size="20" /> -->
					<view class="rate-inline">
						<uni-rate :readonly="true" :value="3" size="15" />
					</view>
				</view>
				<view class="row time">
					<text class="label">评价时间：</text>
					<text class="time-text">2023-03-12 11:02</text>
				</view>
			</uni-card>

			<uni-card is-shadow>
				<view class="card-header">
					<text class="name">张女士</text>
					<uni-tag text="查看详情" type="primary" size="large" custom-style="border-radius: 26rpx;" />
				</view>
				<view class="divider" />
				<view class="row">
					<text class="link">订单编号：</text>
					<text class="number">2021010831213</text>
				</view>
				<view class="row">
					<text class="label">综合评分：</text>
					<text class="score">3分</text>
					<!-- <uni-rate :value="3" :max="5" disabled color="#e5e5e5" active-color="#ffff00" size="20" /> -->
					<view class="rate-inline">
						<uni-rate :readonly="true" :value="3" size="15" />
					</view>
				</view>
				<view class="row time">
					<text class="label">评价时间：</text>
					<text class="time-text">2023-03-12 11:02</text>
				</view>
			</uni-card>
		</view>
	</view>
</template>

<script>
	// export default {
	// 	name: 'Assessment',
	// 	data() {
	// 		return {}
	// 	}
	// }
	export default {
		components: {},
		data() {
			return {
				rateValue: 0
			}
		},
		onLoad() {
			// 模拟动态赋值
			setTimeout(() => {
				this.rateValue = 3
			}, 1000)
		},
		methods: {
			onChange(e) {
				console.log('rate发生改变:' + JSON.stringify(e))
				// console.log(this.rateValue);
			}
		}
	}
</script>

<style>
	.page {
		background-color: #f5f6f7;
		min-height: 100vh;
		position: relative;
	}

	.header {
		background-color: transparent;
		height: 170rpx;
	}

	/* 顶部蓝色背景 */
	.blue-background {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 300rpx;
		background: linear-gradient(120deg, #3385fd 0%, #3385fd 100%);
	}

	.list {
		position: absolute;
		left: 1%;
		right: 1%;
		top: -10rpx; /* 悬浮在蓝色背景上方约20rpx */
		z-index: 2;
		padding: 10rpx 1rpx 24rpx;
		
	}

	/* 加大卡片圆角 */
	.list .uni-card,
	.list .uni-card__content,
	.list .uni-card__header {
		border-radius: 20rpx;
		overflow: hidden;
	}

	.card-header {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 24rpx 24rpx 18rpx 24rpx;
	}

	.name {
		font-size: 32rpx;
		color: #1a1a1a;
		font-weight: 600;
	}

	.divider {
		height: 2rpx;
		background-color: #f0f0f0;
		margin: 0 24rpx 20rpx 24rpx;
	}

	.row {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-bottom: 8rpx;
		flex-wrap: nowrap;
		padding: 0 24rpx;
	}

	/* 评分组件容器，保持与文字同一行 */
	.rate-inline {
		display: inline-flex;
		flex: none;
		margin-left: 3rpx;
	}

	.label {
		font-size: 28rpx;
		color: #666666;
	}

	.link {
		font-size: 28rpx;
		color: #55aaff;
		/* text-decoration: underline; */
	}
	.number {
		font-size: 28rpx;
		color: #55aaff;
		/* text-decoration: underline; */
	}

	.score {
		font-size: 28rpx;
		color: #666666;
		margin-right: 12rpx;
	}

	.time {
		margin-top: 4rpx;
		padding-bottom: 24rpx;
	}

	.time-text {
		font-size: 26rpx;
		color: #9e9e9e;
	}
</style>